<template>
  <div style="padding: 0 20%;">
    <div class="title">基本布局</div>
    <vw-row tag="a">
      <vw-col :span="24"
        ><div class="grid-content bg-purple-dark"></div
      ></vw-col>
    </vw-row>
    <vw-row>
      <vw-col :span="12"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="12"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
    </vw-row>
    <vw-row>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
    </vw-row>

    <div class="title">分栏间隔</div>
    <vw-row :gutter="20">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>

    <div class="title">分栏偏移</div>
    <vw-row :gutter="20">
      <vw-col :span="6" :offset="6"
        ><div class="grid-content bg-purple"></div
      ></vw-col>
      <vw-col :span="6" :offset="6"
        ><div class="grid-content bg-purple"></div
      ></vw-col>
    </vw-row>
    <div class="title">flex布局</div>
    <vw-row type="flex" class="row-bg">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>
    <vw-row type="flex" class="row-bg" justify="center">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>
    <vw-row type="flex" class="row-bg" justify="flex-end">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>
    <vw-row type="flex" class="row-bg" justify="space-between">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>
    <vw-row type="flex" class="row-bg" justify="space-around">
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
      <vw-col :span="6"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :span="6"><div class="grid-content bg-purple"></div></vw-col>
    </vw-row>

    <div class="title">响应式布局</div>
    <vw-row :gutter="10">
      <vw-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1"
        ><div class="grid-content bg-purple"></div
      ></vw-col>
      <vw-col :xs="4" :sm="6" :md="8" :lg="9" :xl="11"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
      <vw-col :xs="4" :sm="6" :md="8" :lg="9" :xl="11"
        ><div class="grid-content bg-purple"></div
      ></vw-col>
      <vw-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1"
        ><div class="grid-content bg-purple-light"></div
      ></vw-col>
    </vw-row>

    <div class="title">珊格移动</div>
    <vw-row :gutter="10">
      <vw-col :span="6" :push="2"
        ><div class="grid-content bg-purple-light">push</div></vw-col
      >
      <vw-col :span="6" :pull="8"
        ><div class="grid-content bg-purple">pull</div></vw-col
      >
    </vw-row>
  </div>
</template>

<script>
  export default {
    name: 'row'
  }
</script>

<style lang="scss">
  .title {
    padding: 20px;
    font-weight: 500px;
  }
  .vw-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .vw-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
</style>
